﻿
using System.Text.RegularExpressions;

namespace RegexpMatching.Matchers
{
  /// <summary>
  ///  Represents class with static methods for matching indexes
  /// </summary>
  public class IndexMatcher
  {
    /// <summary>
    /// Regexp for email matching
    /// </summary>
    private const string IndexRegexp = @"^\s*\d{5,6}\s*$";

    /// <summary>
    /// Default constructor (hided)
    /// </summary>
    private IndexMatcher()
    {
    }

    /// <summary>
    /// Tests if string matches index
    /// </summary>
    /// <param name="input">string to be testes</param>
    /// <returns>true if string represents index, false otherwise</returns>
    public static bool IsMatch(string input)
    {
      return Regex.IsMatch(input, IndexRegexp);
    }

  }
}
